A 4-component vector class, with integers.
More...
A 4-component vector class, with integers.
◆ IVector() [1/8]
nkMaths::IVector::IVector |
( |
| ) |
|
◆ IVector() [2/8]
nkMaths::IVector::IVector |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
2D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
◆ IVector() [3/8]
nkMaths::IVector::IVector |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
3D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
z | The z component to assign. |
◆ IVector() [4/8]
nkMaths::IVector::IVector |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z, |
|
|
int |
w |
|
) |
| |
4D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
z | The z component to assign. |
w | The w component to assign. |
◆ IVector() [5/8]
nkMaths::IVector::IVector |
( |
const Vector & |
other | ) |
|
Copy constructor.
- Parameters
-
other | The vector to copy from. |
◆ IVector() [6/8]
nkMaths::IVector::IVector |
( |
const IVector & |
other | ) |
|
Copy constructor.
- Parameters
-
other | The vector to copy from. |
◆ IVector() [7/8]
nkMaths::IVector::IVector |
( |
const DirectX::XMVECTOR & |
value | ) |
|
Fill constructor.
- Parameters
-
◆ IVector() [8/8]
nkMaths::IVector::IVector |
( |
const DirectX::XMVECTORI32 & |
value | ) |
|
Fill constructor.
- Parameters
-
◆ ~IVector()
nkMaths::IVector::~IVector |
( |
| ) |
|
◆ getX()
int nkMaths::IVector::getX |
( |
| ) |
const |
◆ getY()
int nkMaths::IVector::getY |
( |
| ) |
const |
◆ getZ()
int nkMaths::IVector::getZ |
( |
| ) |
const |
◆ getW()
int nkMaths::IVector::getW |
( |
| ) |
const |
◆ getValues()
DirectX::XMVECTORI32 nkMaths::IVector::getValues |
( |
| ) |
const |
- Returns
- The values compressed in the DirectXMath structure.
◆ setX()
void nkMaths::IVector::setX |
( |
int |
value | ) |
|
Sets the x component.
- Parameters
-
◆ setY()
void nkMaths::IVector::setY |
( |
int |
value | ) |
|
Sets the y component.
- Parameters
-
◆ setZ()
void nkMaths::IVector::setZ |
( |
int |
value | ) |
|
Sets the z component.
- Parameters
-
◆ setW()
void nkMaths::IVector::setW |
( |
int |
value | ) |
|
Sets the w component.
- Parameters
-
◆ addX()
void nkMaths::IVector::addX |
( |
int |
value | ) |
|
Adds to the x component.
- Parameters
-
◆ addY()
void nkMaths::IVector::addY |
( |
int |
value | ) |
|
Adds to the y component.
- Parameters
-
◆ addZ()
void nkMaths::IVector::addZ |
( |
int |
value | ) |
|
Adds to the z component.
- Parameters
-
◆ addW()
void nkMaths::IVector::addW |
( |
int |
value | ) |
|
Adds to the w component.
- Parameters
-
◆ multX()
void nkMaths::IVector::multX |
( |
int |
value | ) |
|
Multiply the x component.
- Parameters
-
value | The value to multiply. |
◆ multY()
void nkMaths::IVector::multY |
( |
int |
value | ) |
|
Multiply the y component.
- Parameters
-
value | The value to multiply. |
◆ multZ()
void nkMaths::IVector::multZ |
( |
int |
value | ) |
|
Multiply the z component.
- Parameters
-
value | The value to multiply. |
◆ multW()
void nkMaths::IVector::multW |
( |
int |
value | ) |
|
Multiply the w component.
- Parameters
-
value | The value to multiply. |
◆ getLength()
float nkMaths::IVector::getLength |
( |
| ) |
const |
- Returns
- The length of the vector.
◆ getLengthSquared()
int nkMaths::IVector::getLengthSquared |
( |
| ) |
const |
- Returns
- The length of the vector, quared. For simple comparisons, if possible, prefer this function as it is more performant.
◆ getDistanceSquared()
int nkMaths::IVector::getDistanceSquared |
( |
const IVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The distance between both vectors, squared. Prefer to use this function when possible as it is more performant.
◆ getDistance()
float nkMaths::IVector::getDistance |
( |
const IVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The distance between both vectors.
◆ fromString()
void nkMaths::IVector::fromString |
( |
const char * |
str | ) |
|
Parse components from a string. Format is "x,y,z,w".
- Parameters
-
◆ operator=() [1/2]
Assignment operator.
- Parameters
-
other | The vector to overwrite from. |
- Returns
- The calling vector, updated.
◆ operator=() [2/2]
Assignment operator.
- Parameters
-
other | The vector to overwrite from. |
- Returns
- The calling vector, updated.
◆ operator+()
Addition operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator+=()
void nkMaths::IVector::operator+= |
( |
const IVector & |
other | ) |
|
Addition and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator-()
Subtraction operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator-=()
void nkMaths::IVector::operator-= |
( |
const IVector & |
other | ) |
|
Subtraction and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator*() [1/2]
Multiplication operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator*=() [1/2]
void nkMaths::IVector::operator*= |
( |
const IVector & |
other | ) |
|
Multiplication and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator*() [2/2]
IVector nkMaths::IVector::operator* |
( |
int |
coeff | ) |
const |
Multiplication operator.
- Parameters
-
coeff | The scalar to operate with. |
- Returns
- A result vector, after operation application on all components.
◆ operator*=() [2/2]
void nkMaths::IVector::operator*= |
( |
int |
coeff | ) |
|
Multiplication and assignment operator.
- Parameters
-
coeff | The scalar to operate with. |
◆ operator/() [1/2]
Division operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator/=() [1/2]
void nkMaths::IVector::operator/= |
( |
const IVector & |
other | ) |
|
Division and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator/() [2/2]
IVector nkMaths::IVector::operator/ |
( |
int |
coeff | ) |
const |
Division operator.
- Parameters
-
coeff | The scalar to operate with. |
- Returns
- A result vector, after operation application on all components.
◆ operator/=() [2/2]
void nkMaths::IVector::operator/= |
( |
int |
coeff | ) |
|
Division and assignment operator.
- Parameters
-
coeff | The scalar to operate with. |
◆ operator==()
bool nkMaths::IVector::operator== |
( |
const IVector & |
other | ) |
const |
Equality operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the vectors are equal (true) or not (false).
◆ operator<()
bool nkMaths::IVector::operator< |
( |
const IVector & |
other | ) |
const |
Less than operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is smaller (true) or not (false).
◆ operator<=()
bool nkMaths::IVector::operator<= |
( |
const IVector & |
other | ) |
const |
Less than or equal operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is smaller, equal (true) or not (false).
◆ operator>()
bool nkMaths::IVector::operator> |
( |
const IVector & |
other | ) |
const |
Greater than operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is greater (true) or not (false).
◆ operator>=()
bool nkMaths::IVector::operator>= |
( |
const IVector & |
other | ) |
const |
Greater than or equal operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is greater, equal (true) or not (false).
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsMaths/Algebra/IVector.h